import type { App } from "vue";

import { createRouter, createWebHashHistory } from "vue-router";

import { BasicRoutes } from "@/routers/modules";

// 总路由
export const router = createRouter({
  history: createWebHashHistory(),
  routes: BasicRoutes,
  strict: true,
  scrollBehavior: () => ({ left: 0, top: 0 }),
});

// 注册路由
export function setupRouter(app: App<Element>) {
  app.use(router);
}
